
public class map
{
	public void create(mkv MapArr,int size)
	{
		for(int i = 0;i < size;i++)
		{
			MapArr.key.add(null);
			MapArr.value.add(null);
		}
	}
	
	public void add(mkv MapArr,String Key,String Value)
	{
		int check = 0;
		int size = MapArr.key.size();
		for(int i = 0;i < size;i++)
		{
			if(MapArr.key.get(i) == Key)
			{
				check++;
			}
		}
		if(check > 0)
		{
			System.out.println("This element already exists");
		}
		else
		{
			for(int i = 0;i < size;i++)
			{
				if(MapArr.key.get(i) == null)
				{
					MapArr.key.set(i, Key);
					MapArr.value.set(i, Value);
					i = size;
				}
				
			}
			
		}
	}
	
	public void delete(mkv MapArr,String Key)
	{
		int size = MapArr.key.size();
		int check = 0;
		for(int i = 0;i < size;i++)
		{
			if(MapArr.key.get(i) == Key)
			{
				MapArr.key.remove(i);
				MapArr.value.remove(i);
				check++;
				i = size;
			}
		}
		if(check > 0)
			System.out.println("This element has been successfully removed");
		else
			System.out.println("Such element does not exist or it has already been removed");
	}
	
	public void justsearc(mkv MapArr,String Key)
	{
		int size = MapArr.key.size();
		int check = 0;
		for(int i = 0;i < size;i++)
		{
			if(MapArr.key.get(i) == Key)
			{
				System.out.println(MapArr.value.get(i));
				i = size;
				check++;
			}
		}
		if(check == 0)
			System.out.println("Such element does not exist");	
	}
	
	public void printmap(mkv MapArr)
	{
		int size = MapArr.key.size();
		for(int i = 0;i < size;i++)
		{
			if(MapArr.key.get(i) != null)
			{
				System.out.print(MapArr.key.get(i));
				System.out.print(":");
				System.out.println(MapArr.value.get(i));
			}			
		}
		System.out.println(" ");
	}
}
